package com.minimalist.common.entity.basic.po;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;


import java.io.Serial;
import java.io.Serializable;

/**
 * 岗位表 实体类。
 *
 * @author 小太阳
 * @since 2024-10-18
 */

@Table(value = "m_post", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class MPost extends BaseEntity implements Serializable{

    public MPost() {
    }

    public MPost(Long postId, String postCode, String postName, Integer postSort, String remark, Integer status, Long tenantId) {
        this.postId = postId;
        this.postCode = postCode;
        this.postName = postName;
        this.postSort = postSort;
        this.remark = remark;
        this.status = status;
        this.tenantId = tenantId;
    }

    public Long getPostId() {
        return postId;
    }

    public void setPostId(Long postId) {
        this.postId = postId;
    }

    public String getPostCode() {
        return postCode;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }

    public String getPostName() {
        return postName;
    }

    public void setPostName(String postName) {
        this.postName = postName;
    }

    public Integer getPostSort() {
        return postSort;
    }

    public void setPostSort(Integer postSort) {
        this.postSort = postSort;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public static MPostBuilder builder() {
        return new MPostBuilder();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        MPost mPost = (MPost) o;
        return java.util.Objects.equals(postId, mPost.postId) &&
               java.util.Objects.equals(postCode, mPost.postCode) &&
               java.util.Objects.equals(postName, mPost.postName) &&
               java.util.Objects.equals(postSort, mPost.postSort) &&
               java.util.Objects.equals(remark, mPost.remark) &&
               java.util.Objects.equals(status, mPost.status) &&
               java.util.Objects.equals(tenantId, mPost.tenantId);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), postId, postCode, postName, postSort, remark, status, tenantId);
    }

    public static class MPostBuilder {
        private Long postId;
        private String postCode;
        private String postName;
        private Integer postSort;
        private String remark;
        private Integer status;
        private Long tenantId;

        public MPostBuilder postId(Long postId) {
            this.postId = postId;
            return this;
        }

        public MPostBuilder postCode(String postCode) {
            this.postCode = postCode;
            return this;
        }

        public MPostBuilder postName(String postName) {
            this.postName = postName;
            return this;
        }

        public MPostBuilder postSort(Integer postSort) {
            this.postSort = postSort;
            return this;
        }

        public MPostBuilder remark(String remark) {
            this.remark = remark;
            return this;
        }

        public MPostBuilder status(Integer status) {
            this.status = status;
            return this;
        }

        public MPostBuilder tenantId(Long tenantId) {
            this.tenantId = tenantId;
            return this;
        }

        public MPost build() {
            return new MPost(postId, postCode, postName, postSort, remark, status, tenantId);
        }
    }

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 岗位ID
     */
    private Long postId;

    /**
     * 岗位编码
     */
    private String postCode;

    /**
     * 岗位名称
     */
    private String postName;

    /**
     * 显示顺序
     */
    private Integer postSort;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态  0禁用 1正常
     */
    private Integer status;

    /**
     * 租户编号
     */
    @Column(tenantId = true)
    private Long tenantId;

}
